package manong.beans;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;

public class College implements Cloneable, Serializable {

    private Integer id;
    private String collegeName;
    private Integer collegeDescribe;
    private Integer statu;
    private String mark;

    private static final long serialVersionUID = 1L;

    public College(Integer id, String collegeName, Integer collegeDescribe, Integer statu, String mark) {
        this.id = id;
        this.collegeName = collegeName;
        this.collegeDescribe = collegeDescribe;
        this.statu = statu;
        this.mark = mark;
    }

    public College() {
        super();
    }


    public Integer getId() {
        return id;
    }

    public College withId(Integer id) {
        this.setId(id);
        return this;
    }

 
    public void setId(Integer id) {
        this.id = id;
    }

    public String getCollegeName() {
        return collegeName;
    }

   College withCollegeName(String collegeName) {
        this.setCollegeName(collegeName);
        return this;
    }

    public void setCollegeName(String collegeName) {
        this.collegeName = collegeName;
    }


    public Integer getCollegeDescribe() {
        return collegeDescribe;
    }

    public College withCollegeDescribe(Integer collegeDescribe) {
        this.setCollegeDescribe(collegeDescribe);
        return this;
    }


    public void setCollegeDescribe(Integer collegeDescribe) {
        this.collegeDescribe = collegeDescribe;
    }

  
    public Integer getStatu() {
        return statu;
    }

  
    public College withStatu(Integer statu) {
        this.setStatu(statu);
        return this;
    }

   
    public void setStatu(Integer statu) {
        this.statu = statu;
    }

  
    public String getMark() {
        return mark;
    }

 
    public College withMark(String mark) {
        this.setMark(mark);
        return this;
    }

 
    public void setMark(String mark) {
        this.mark = mark;
    }

  
    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        College other = (College) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCollegeName() == null ? other.getCollegeName() == null : this.getCollegeName().equals(other.getCollegeName()))
            && (this.getCollegeDescribe() == null ? other.getCollegeDescribe() == null : this.getCollegeDescribe().equals(other.getCollegeDescribe()))
            && (this.getStatu() == null ? other.getStatu() == null : this.getStatu().equals(other.getStatu()))
            && (this.getMark() == null ? other.getMark() == null : this.getMark().equals(other.getMark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCollegeName() == null) ? 0 : getCollegeName().hashCode());
        result = prime * result + ((getCollegeDescribe() == null) ? 0 : getCollegeDescribe().hashCode());
        result = prime * result + ((getStatu() == null) ? 0 : getStatu().hashCode());
        result = prime * result + ((getMark() == null) ? 0 : getMark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", collegeName=").append(collegeName);
        sb.append(", collegeDescribe=").append(collegeDescribe);
        sb.append(", statu=").append(statu);
        sb.append(", mark=").append(mark);
        sb.append("]");
        return sb.toString();
    }

   
    @Override
    public College clone() throws CloneNotSupportedException {
        return (College) super.clone();
    }

   
    public enum Column {
        id("id", "id", "INTEGER", false),
        collegeName("college_name", "collegeName", "VARCHAR", false),
        collegeDescribe("college_describe", "collegeDescribe", "INTEGER", false),
        statu("statu", "statu", "INTEGER", false),
        mark("mark", "mark", "VARCHAR", false);

   
        private static final String BEGINNING_DELIMITER = "`";

     
        private static final String ENDING_DELIMITER = "`";

    
        private final String column;

        private final boolean isColumnNameDelimited;

      
        private final String javaProperty;

      
        private final String jdbcType;

       
        public String value() {
            return this.column;
        }

       
        public String getValue() {
            return this.column;
        }

       
        public String getJavaProperty() {
            return this.javaProperty;
        }

   
        public String getJdbcType() {
            return this.jdbcType;
        }

      
        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

     
        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

      
        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

       
        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

     
        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }
    }
}